package iterator;import java.util.ArrayList;import java.util.Iterator;/** * Created by Administrator on 2018-10-29. */public class NewWaitress {       ArrayList menus;     public NewWaitress(ArrayList memus){       this.menus=menus;    }    public void printMenu(){      Iterator menuIterator = menus.iterator();      while(menuIterator.hasNext()){          Menu menu = (Menu)menuIterator.next();          printMenu(menu.createIterator());      }    }    private void printMenu(Iterator iterator){        while (iterator.hasNext()){            MenuItem menuItem = (MenuItem)iterator.next();            System.out.println(menuItem.getName()+",");            System.out.println(menuItem.getPrice()+",");            System.out.println(menuItem.getDescription());        }    }}